package com.guldan.jaina.task;

import com.guldan.core.constants.CommonConstant;
import com.guldan.jaina.common.task.BaseTask;
import com.guldan.jaina.dto.datastat.datav.DatavDTO;
import com.guldan.jaina.manager.ReportManager;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by Silas.
 * Date: 2017/5/6
 * Time: 21:46
 */
@Component
public class StatDatavDataTask extends BaseTask {

    @Autowired
    private ReportManager reportManager;

    @Override
    public void execute() throws Exception {
        Set<String> codeList = new HashSet<>();
//        codeList.add("630000");
        codeList.add("630100");


        for (String code : codeList) {
            long begin = System.currentTimeMillis();
            reportManager.statDatavDataToMysql(code);
            logger.error("StatDatavDataTask execute cost " + (System.currentTimeMillis() - begin));
        }

    }

}
